package com.hdax.dm.controller;

import com.hdax.dm.dto.FlootDto;
import com.hdax.dm.dto.ItemCinemaDto;
import com.hdax.dm.dto.ItemDto;
import com.hdax.dm.entity.item.DmItem;
import com.hdax.dm.service.MultipleService;
import com.hdax.dm.utils.response.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/item/multiple")
public class MultipleController {

    @Autowired
    private MultipleService multipleService;


    //获取页面广告地址及信息页面
    @PostMapping("getAdimgUrl")
    private CommonResponse<List<ItemCinemaDto>> adimgUrl(@RequestBody Map<String,Integer> map){
        return multipleService.adimgUrl(map.get("itemTypeId"));
    }

    //商品轮播图
    @PostMapping("getCarouselData")
    private CommonResponse<List<ItemDto>> getCarouselData(@RequestBody Map<String,Integer> map){
        return multipleService.getCarouselData(map.get("itemTypeId"));
    }

    // 获取猜你喜欢界面数据信息
    @PostMapping("getGuessYouLike")
    private CommonResponse<List<ItemCinemaDto>> getGuessYouLike(@RequestBody Map<String,Integer> map){
        return multipleService.getGuessYouLike(map.get("itemTypeId"));
    }

    // 获取精彩聚焦界面数据信息
    @PostMapping("getWonderfulData")
    private CommonResponse<List<ItemCinemaDto>> getWonderfulData(@RequestBody Map<String,Integer> map){
        return multipleService.getWonderfulData(map.get("itemTypeId"));
    }

    // 获取热门排行数据信息
    @PostMapping("getPopularSearch")
    private CommonResponse<List<ItemCinemaDto>> getPopularSearch(@RequestBody Map<String,Integer> map){
        return multipleService.getPopularSearch(map.get("itemTypeId"));
    }

    // 获取日历栏界面数据信息

    @PostMapping("getCalendarData")
    private CommonResponse<List<Map<String,Object>>> getCalendarData(@RequestBody Map<String,Integer> map){
        return multipleService.getCalendarData(map.get("itemTypeId"));
    }

    // 获取亲子界面ParentChildTabs 界面数据信息
    @PostMapping("getParentChild")
    private CommonResponse<List<ItemCinemaDto>> getParentChild(@RequestBody Map<String,Integer> map){
        return multipleService.getParentChild(map.get("ageGroup"),map.get("limit"));
    }
}
